
/** 개인정보>개인정보 를 호출되어지는 데이터 처리 Controller                                
* @FileName  : MemberInfoController.java 0.1 2014년09월12일(14:05:50)       
* @Project     : nComz n-eip 프로젝트   
* @Date         : 2014년09월12일(14:05:50)          
* @작성자      : 신용천(nComz)           	  
* @변경이력 :                         
* @프로그램 설명 :개인정보>개인정보(Controller)    
* Copyright 2012 (주)nComz Cop. All rights Reserved.                  
*/ 

package com.sunny.hp.member; 

import java.util.ArrayList; 
import java.util.LinkedHashMap; 
import java.util.LinkedList; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.stereotype.Controller; 
import org.springframework.web.bind.annotation.RequestMapping; 
import org.springframework.web.servlet.view.json.MappingJacksonJsonView; 
import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.sunny.hp.common.vo.*;
import com.sunny.hp.member.service.MemberInfoService; 
import com.sunny.hp.common.servlet.ModelAndNCOMZView; 
import com.sunny.hp.common.util.HttpRequest; 
import com.sunny.hp.member.service.MemberInfoService;

/** 개인정보>개인정보 를 호출되어지는 데이터 처리 Controller                               
* @ClassName  : MemberInfoController       
* @Date         : 2014년09월12일(14:05:50)         
* @작성자      : 신용천(nComz)           	 
* @변경이력 :                        
* @프로그램 설명 :개인정보>개인정보(Controller)                     
*/      

@Controller
@RequestMapping("/member")
public class MemberInfoController {

	@Autowired
	private MemberInfoService memberInfoService; 

	protected final Log logger = LogFactory.getLog(getClass());

	/**  개인정보>개인정보>개인정보 리스트 화면 					
	* @Method Name  : selectMemberInfoListView   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 리스트 화면                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/selectMemberInfoListView.do")
	public ModelAndNCOMZView selectMemberInfoListView(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request);
	mav.setViewName("member/selectMemberInfoListView");

	return mav;
	}


	/**  개인정보>개인정보>개인정보 리스트 					
	* @Method Name  : selectMemberInfoList   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 리스트                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/selectMemberInfoList.do")
	public ModelAndNCOMZView selectMemberInfoList(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	ArrayList<LinkedHashMap> retList1 = new ArrayList<LinkedHashMap>();
	try {
		retList1 = (ArrayList<LinkedHashMap>)memberInfoService.selectMemberInfoList(param);
		mav.addObject("retList1", retList1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  개인정보>개인정보>개인정보 세부정보 가져오기 					
	* @Method Name  : selectMemberInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 세부정보 가져오기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/selectMemberInfo.do")
	public ModelAndNCOMZView selectMemberInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	LinkedHashMap resultMap1 = new LinkedHashMap(); 
	try {
		resultMap1 = memberInfoService.selectMemberInfo(param);
		mav.addObject("resultMap1", resultMap1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  개인정보>개인정보>개인정보 등록하기 					
	* @Method Name  : insertMemberInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 등록하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/insertMemberInfo.do")
	public ModelAndNCOMZView insertMemberInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	int resultInt2 = 0;
	try {
		resultInt2 = memberInfoService.selectMemberKey(param);
		resultInt1 = memberInfoService.insertMemberInfo(param);
		
		mav.addObject("resultInt1", resultInt1); 
		mav.addObject("resultInt2", resultInt2); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  개인정보>개인정보>개인정보 수정하기 					
	* @Method Name  : updateMemberInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 수정하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/updateMemberInfo.do")
	public ModelAndNCOMZView updateMemberInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	try {
		resultInt1 = memberInfoService.updateMemberInfo(param);
		mav.addObject("resultInt1", resultInt1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  개인정보>개인정보>개인정보 삭제하기 					
	* @Method Name  : deleteMemberInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 개인정보 삭제하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/deleteMemberInfo.do")
	public ModelAndNCOMZView deleteMemberInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	try {
		resultInt1 = memberInfoService.deleteMemberInfo(param);
		mav.addObject("resultInt1", resultInt1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}

}
